package com.yqzl.controller;

import com.yqzl.util.DataUtils;
import com.yqzl.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;

@RestController
public class ResourcesController {


  @RequestMapping("/getimages")
  public Result getLBTPic(HashMap map) {
    map.put("images", DataUtils.initImage());
    return Result.success(map);
  }


  @RequestMapping("/getGoodsByName")
  public Result getGoodsByName(String goodsName) {
    System.out.print(DataUtils.getGoodSbyGoodsName(goodsName));
    return Result.success(DataUtils.getGoodSbyGoodsName(goodsName));
  }


  @RequestMapping("/getGoodsDetail")
  public Result getGoodsDetail(String goodsName) {
    System.out.print(DataUtils.getGoodsDetail(goodsName));
    return Result.success(DataUtils.getGoodsDetail(goodsName));
  }

  @RequestMapping("/getLike")
  public Result getLike() {
    return Result.success(DataUtils.getLike());
  }

//  返回频道广场 的图片路径


  @RequestMapping("/getGC")
  public Result getGC() {
    ArrayList<String> imgs = new ArrayList<>();
    imgs.add("dist/upload/channel/01.png");
    imgs.add("dist/upload/channel/02.png");
    imgs.add("dist/upload/channel/03.png");
    imgs.add("dist/upload/channel/04.png");
    imgs.add("dist/upload/channel/05.png");
    imgs.add("dist/upload/channel/06.png");
    return Result.success(imgs);
  }


}
